package com.ruoyi.flow.common.tools.mediaconverter.converter.command;

/**
 * Created by Administrator on 2017/7/17.
 */
public class CommandWorker extends Thread {
    private final Process process;
    private final CommandWatcher watchThread;
    private Integer exit;

    public CommandWorker(Process process,CommandWatcher watchThread) {
        this.process = process;
        this.watchThread = watchThread;
    }

    @Override
    public void run() {
        try {
            this.watchThread.start();
            exit = process.waitFor();
            this.watchThread.setOver(true);
        } catch (InterruptedException e) {
            return;
        }
    }

    public Integer getExit() {
        return exit;
    }
}
